com.rscja.deviceapi

## Class RFIDWithUHFA4

- java.lang.Object
- - com.rscja.deviceapi.UhfBase
  - - com.rscja.team.qcom.deviceapi.RFIDWithUHFUART_qcom
    - - com.rscja.team.qcom.deviceapi.RFIDWithUHFAxBase_qcom
      - - com.rscja.deviceapi.RFIDWithUHFA4

- All Implemented Interfaces:
    IHandheldRFID, IMultipleAntenna, IRFIDWithUHFA4, ISingleAntenna, IUHF, IUHFOfAndroidUart, IURAxOfAndroidUart

      public class RFIDWithUHFA4
      extends RFIDWithUHFAxBase_qcom
      implements IRFIDWithUHFA4, IUHFOfAndroidUart

  UHF模块 A4操作类
  UHF module operation type
  第一步:通过`init(Context context)` 连接读写器。
  Step 1: Connect to the usb of the reader via`init(Context context)`
  第二步： 如果是设置参数，连接成功之后，调用对应的函数设置参数、读写操作。 如果是盘点标签先调用`setInventoryCallback(IUHFInventoryCallback inventoryCallback)`设置标签回调接口，有标签数据就会回调这个接口。 然后在调用`startInventoryTag()`函数开始执行盘点。 注意: 在盘点标签的时候rfid模块只能响应`stopInventory()`函数。
  Step 2: If it is to set parameters, after the connection is successful, call the corresponding function to set parameters, read and write operations. * If the inventory label is to call `setInventoryCallback(IUHFInventoryCallback inventoryCallback)` first to set the label callback interface, this interface will be called back when there is label data. * Then call the `startInventoryTag()` function to start the inventory. * Note: The rfid module can only respond to the `stopInventory()` function when inventorying tags.
  第三步：退出app调用 `free()`断开连接，如果断开之前正在盘点，请先停止盘点，在断开连接。
  Step 3: Exit the app and call `free()` to disconnect. If you are taking inventory before disconnecting, please stop the inventory first and then disconnecting.
  Example Usage:
  public void RFIDWithUHFUARTTest(){
  RFIDWithUHFA4 rfid=RFIDWithUHFA4.getInstance();
  boolean result=rfid.init(Context context);
  if(!result){
  //connect fail
  return;
  }
  //connect success
  //configuration parameters
  //rfid.setFrequencyMode(xx)
  rfid.setInventoryCallback(new IUHFInventoryCallback() {
  @Override
  public void callback(UHFTAGInfo uhftagInfo) {
  String epc= uhftagInfo.getEPC();
  String rssi= uhftagInfo.getRssi();
  //........
  }
  }); *
  if(rfid.startInventoryTag()){
  //success
  }else{
  //fail
  }
  rfid.stopInventory();
  //.................
  //disconnect uhf
  rfid.free();
  } * * * *

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.rscja.deviceapi.UhfBase

      `UhfBase.ErrorCode`

  - ### Field Summary

    - ### Fields inherited from interface com.rscja.deviceapi.interfaces.IUHF

      `Bank_EPC, Bank_RESERVED, Bank_TID, Bank_USER, LockBank_ACCESS, LockBank_EPC, LockBank_KILL, LockBank_TID, LockBank_USER, LockMode_LOCK, LockMode_OPEN, LockMode_PLOCK, LockMode_POPEN, UPDATE_UHF`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `buzzer()` 成功的通知提示(发出提示音) Success Notification Sound (Play Sound)
    `boolean` | `free()` 关闭UHF模块 Switch off UHF module
    `java.util.List<AntennaState>` | `getANT()` 获取当前设置的天线 Acquire current antenna
    `static RFIDWithUHFA4` | `getInstance()`
    `boolean` | `init(android.content.Context context)` 初始化UHF模块
    `java.util.List<GPIStateEntity>` | `inputStatus()` input status
    `void` | `led()` 成功的通知提示(指示灯闪烁) Success Notification Sound (flashing light)
    `boolean` | `output1Off()` gpio 3 off
    `boolean` | `output1On()` gpio 3 on
    `boolean` | `output2Off()` gpio 4 off
    `boolean` | `output2On()` gpio 4 on
    `boolean` | `output3Off()` gpio OptoCoupler3 off
    `boolean` | `output3On()` gpio OptoCoupler3 on
    `boolean` | `output4Off()` gpio OptoCoupler4 off
    `boolean` | `output4On()` gpio OptoCoupler4 on
    `boolean` | `outputWgData0Off()` gpio WgData0 off
    `boolean` | `outputWgData0On()` gpio WgData0 on
    `boolean` | `outputWgData1Off()` gpio WgData1 off
    `boolean` | `outputWgData1On()` gpio WgData1 on
    `boolean` | `setANT(java.util.List<AntennaState> antStatus)` 设置天线号 Setup antenna number
    `void` | `setInventoryCallback(IUHFInventoryCallback inventoryCallback)` 设置盘点回调接口，接收循环盘点到的标签数据 Set the inventory callback interface to receive the label data from the cyclic inventory 备注：需要在开始循环盘点`IUHF.startInventoryTag()`之前调用此方法。 Note: This method needs to be called before starting the loop inventory `IUHF.startInventoryTag()`.
    `boolean` | `startInventoryTag()` 开始循环识别标签。
    `boolean` | `stopInventory()` 停止循环识别，在调用此函数之后应当退出循环获取缓冲区的标签信息的子线程 Stop auto reading, after call this function to exit sub threads of tag data of buffer.
    `void` | `successNotify()` 成功的通知提示(指示灯闪烁同时发出提示音) Success Notification Sound (Play notification tune when light flashing)

    - ### Methods inherited from class com.rscja.team.qcom.deviceapi.RFIDWithUHFAxBase_qcom

      `buzzerOn, getAntennaConnectState, getAntennaPower, getAntennaPower, readTagFromBuffer, setAntennaPower`

    - ### Methods inherited from class com.rscja.team.qcom.deviceapi.RFIDWithUHFUART_qcom

      `blockWriteData, eraseData, eraseData, factoryReset, generateLockCode, getConnectStatus, getCW, getEPCAndTIDUserMode, getEPCAndTIDUserModeEx, getErrCode, getFastInventoryMode, getFrequencyMode, getGen2, getHardwareVersion, getLBTMode, getPower, getProtocol, getRFLink, getTagLocate, getTemperature, getVersion, inventorySingleTag, inventorySingleTag, isInventorying, isPowerOn, killTag, killTag, lockMem, lockMem, readData, readData, setConnectionStatusCallback, setCW, setDynamicDistance, setEPCAndTIDMode, setEPCAndTIDUserMode, setEPCAndTIDUserMode, setEPCAndTIDUserModeEx, setEPCAndUserReservedModeEx, setEPCMode, setFastID, setFastInventoryMode, setFilter, setFreHop, setFrequencyMode, setGen2, setGen2, setLBTMode, setPower, setPowerOnBySystem, setProtocol, setRFLink, setTagFocus, setUart, startInventoryTag, startLocation, startRadarLocation, stopLocation, stopRadarLocation, uhfBlockPermalock, uhfJump2Boot, uhfJump2Boot, uhfStartUpdate, uhfStopUpdate, uhfUpdating, UHFVerifyVoltage, writeData, writeData, writeDataToEpc, writeDataToEpc`

    - ### Methods inherited from class com.rscja.deviceapi.UhfBase

      `readTcpServiceState, setOnLowBatteryListener`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.rscja.deviceapi.interfaces.IMultipleAntenna

      `getAntennaPower, getAntennaPower, setAntennaPower`

    - ### Methods inherited from interface com.rscja.deviceapi.interfaces.IUHFOfAndroidUart

      `getErrCode, getHardwareVersion, isPowerOn, setOnLowBatteryListener, setPowerOnBySystem, setUart`

    - ### Methods inherited from interface com.rscja.deviceapi.interfaces.IUHF

      `blockWriteData, eraseData, eraseData, factoryReset, generateLockCode, getConnectStatus, getCW, getEPCAndTIDUserMode, getFastInventoryMode, getFrequencyMode, getGen2, getProtocol, getRFLink, getTemperature, getVersion, inventorySingleTag, isInventorying, killTag, killTag, lockMem, lockMem, readData, readData, readTagFromBuffer, setConnectionStatusCallback, setCW, setEPCAndTIDMode, setEPCAndTIDUserMode, setEPCAndTIDUserMode, setEPCMode, setFastID, setFastInventoryMode, setFilter, setFreHop, setFrequencyMode, setGen2, setProtocol, setRFLink, setTagFocus, uhfBlockPermalock, uhfJump2Boot, uhfJump2Boot, uhfStartUpdate, uhfStopUpdate, uhfUpdating, writeData, writeData, writeDataToEpc, writeDataToEpc`

- - ### Method Detail

    - #### getInstance

          public static RFIDWithUHFA4 getInstance()
                                           throws ConfigurationException

      Throws:
        `ConfigurationException`

    - #### init

          public boolean init(android.content.Context context)

      Description copied from class: `RFIDWithUHFUART_qcom`

      初始化UHF模块

      Initialize UHF module

      Specified by:
        `init` in interface `IUHF`
      Overrides:
        `init` in class `RFIDWithUHFUART_qcom`
      Parameters:
        `context` - context
      Returns:
        true:成功(success) false:失败(failure)

    - #### free

          public boolean free()

      Description copied from class: `RFIDWithUHFUART_qcom`
      关闭UHF模块
      Switch off UHF module
      Specified by:
        `free` in interface `IUHF`
      Overrides:
        `free` in class `RFIDWithUHFAxBase_qcom`
      Returns:
        true:成功(success) false:失败(failure)

    - #### startInventoryTag

          public boolean startInventoryTag()

      开始循环识别标签。

      Begin looping through the identification labels.

      通过 `setInventoryCallback(IUHFInventoryCallback inventoryCallback)` 这个回调接口获取标签数据，需要在开始盘点之前调用setInventoryCallback方法。

      Get the label data through the callback interface `setInventoryCallback(IUHFInventoryCallback inventoryCallback)`, you need to call the setInventoryCallback method before starting the inventory.

      备注：开启循环识别标签后模块只能响应`stopInventory()`函数 。

      Note: The module can only respond to the `stopInventory()` function after the loop identification tag is turned on.

      Specified by:
        `startInventoryTag` in interface `IUHF`
      Overrides:
        `startInventoryTag` in class `RFIDWithUHFAxBase_qcom`
      Returns:
        true:成功(success) false:失败(failure)

    - #### stopInventory

          public boolean stopInventory()

      Description copied from interface: `IUHF`
      停止循环识别，在调用此函数之后应当退出循环获取缓冲区的标签信息的子线程
      Stop auto reading, after call this function to exit sub threads of tag data of buffer.
      Specified by:
        `stopInventory` in interface `IUHF`
      Overrides:
        `stopInventory` in class `RFIDWithUHFUART_qcom`
      Returns:
        true:成功(success) false:失败(failure)

    - #### setInventoryCallback

          public void setInventoryCallback(IUHFInventoryCallback inventoryCallback)

      Description copied from interface: `IUHF`
      设置盘点回调接口，接收循环盘点到的标签数据
      Set the inventory callback interface to receive the label data from the cyclic inventory
      备注：需要在开始循环盘点`IUHF.startInventoryTag()`之前调用此方法。
      Note: This method needs to be called before starting the loop inventory `IUHF.startInventoryTag()`.
      Specified by:
        `setInventoryCallback` in interface `IUHF`
      Overrides:
        `setInventoryCallback` in class `RFIDWithUHFUART_qcom`
      Parameters:
        `inventoryCallback` - 盘点回调接口(inventory callback interface)

    - #### getANT

          public java.util.List<AntennaState> getANT()

      获取当前设置的天线
      Acquire current antenna
      Specified by:
        `getANT` in interface `IMultipleAntenna`
      Overrides:
        `getANT` in class `RFIDWithUHFAxBase_qcom`
      Returns:
        返回已经设置的天线，下标索引加1表示天线号；下标元素的值如果是1表示已经设置了该天线，0反之；
        Return antenna status that has been setup, index will display antenna number.

    - #### setANT

          public boolean setANT(java.util.List<AntennaState> antStatus)

      设置天线号
      Setup antenna number
      Specified by:
        `setANT` in interface `IMultipleAntenna`
      Overrides:
        `setANT` in class `RFIDWithUHFAxBase_qcom`
      Parameters:
        `antStatus` - 下标索引加1表示天线号；下标元素的值如果是1表示设置该天线，0反之；(Return antenna status that has been setup, index will display antenna number.)
      Returns:
        true:成功(success) false:失败(failure)

    - #### output2Off

          public boolean output2Off()

      gpio 4 off
      Specified by:
        `output2Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output2On

          public boolean output2On()

      gpio 4 on
      Specified by:
        `output2On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output1Off

          public boolean output1Off()

      gpio 3 off
      Specified by:
        `output1Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output1On

          public boolean output1On()

      gpio 3 on
      Specified by:
        `output1On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### inputStatus

          public java.util.List<GPIStateEntity> inputStatus()

      input status
      Specified by:
        `inputStatus` in interface `IRFIDWithUHFA4`
      Returns:
        null:fail ; [0]:input1 , [1]:input2 [2]:OptoCoupler_input3 [3]:OptoCoupler_input4

    - #### output3On

          public boolean output3On()

      gpio OptoCoupler3 on
      Specified by:
        `output3On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail OPTOCOUPLER

    - #### output3Off

          public boolean output3Off()

      gpio OptoCoupler3 off
      Specified by:
        `output3Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output4On

          public boolean output4On()

      gpio OptoCoupler4 on
      Specified by:
        `output4On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### output4Off

          public boolean output4Off()

      gpio OptoCoupler4 off
      Specified by:
        `output4Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData0On

          public boolean outputWgData0On()

      gpio WgData0 on
      Specified by:
        `outputWgData0On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData0Off

          public boolean outputWgData0Off()

      gpio WgData0 off
      Specified by:
        `outputWgData0Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData1On

          public boolean outputWgData1On()

      gpio WgData1 on
      Specified by:
        `outputWgData1On` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### outputWgData1Off

          public boolean outputWgData1Off()

      gpio WgData1 off
      Specified by:
        `outputWgData1Off` in interface `IRFIDWithUHFA4`
      Returns:
        true;success false:fail

    - #### successNotify

          public void successNotify()

      成功的通知提示(指示灯闪烁同时发出提示音)
      Success Notification Sound (Play notification tune when light flashing)
      Specified by:
        `successNotify` in interface `IURAxOfAndroidUart`
      Overrides:
        `successNotify` in class `RFIDWithUHFAxBase_qcom`

    - #### led

          public void led()

      成功的通知提示(指示灯闪烁)
      Success Notification Sound (flashing light)
      Specified by:
        `led` in interface `IURAxOfAndroidUart`
      Overrides:
        `led` in class `RFIDWithUHFAxBase_qcom`

    - #### buzzer

          public void buzzer()

      成功的通知提示(发出提示音)
      Success Notification Sound (Play Sound)
      Specified by:
        `buzzer` in interface `IURAxOfAndroidUart`
      Overrides:
        `buzzer` in class `RFIDWithUHFAxBase_qcom`